package com.leonzx.base.service.system;

import com.leonzx.base.dao.system.UreportFileDAO;
import com.leonzx.base.entity.system.UreportFile;
import com.leonzx.base.service.BaseService;
import com.leonzx.base.utils.SQLUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @Author:梁亮
 * @Description:
 * @Date: 2018/7/4 21:22
 */
@Service
public class UreportFileService extends BaseService {

    @Autowired
    private UreportFileDAO ureportFileDAO;

    /**
     *
     * @param ureportFile
     * @return
     */
    public List<UreportFile> getAll(UreportFile ureportFile) {
        Example example = new Example(UreportFile.class);
        Example.Criteria criteria = example.createCriteria();
        if (StringUtils.isNotBlank(ureportFile.getName())) {
            criteria.andLike("name", SQLUtils.like(ureportFile.getName()));
        }
        return ureportFileDAO.selectByExample(example);
    }
}
